import time

def vozv(a):
    st = True
    while st:
        st = False
        for j in range(len(a) - 1):
            if a[j] > a[j + 1]:
                a[j], a[j + 1] = a[j + 1], a[j]
                st = True
    return a

def name(f):
    file = open(f)
    nam = file.readlines()
    for i in range(len(nam)):
        nam[i] = int(nam[i])
    return nam


fal = "m1_sorted.txt"
f = name(fal)
t_s = time.time()
vozv(f)
t_f = time.time()
print(fal[:-4], round((t_f - t_s) * 1000), "milliseconds")

fal = "m2_reverse.txt"
f = name(fal)
t_s = time.time()
vozv(f)
t_f = time.time()
print(fal[:-4], round((t_f - t_s) * 1000), "milliseconds")

fal = "m3_shuffle.txt"
f = name(fal)
t_s = time.time()
vozv(f)
t_f = time.time()
print(fal[:-4], round((t_f - t_s) * 1000), "milliseconds")